//
//  FunnyButtonUIView.m
//  USB_Reader
//
//  Created by xiaozao on 15/3/24.
//  Copyright (c) 2015年 Tony_Wang. All rights reserved.
//

#import "FunnyButtonUIView.h"

@implementation FunnyButtonUIView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame laughLable:(NSString *)laughNumber cryLabel:(NSString *)cryNumber
{
    self = [super init];
//    if (self) {
        self.frame = frame;
        self.backgroundColor = [UIColor greenColor];
        self.laugh.frame = CGRectMake(10, 0, 20, 20);
        self.laugh.imageView.image = [UIImage imageNamed:@"laugh.png"];
        self.cry.frame = CGRectMake(80, 0, 20, 20);
        self.cry.imageView.image = [UIImage imageNamed: @"cry.png"];
        self.laughLabel.frame = CGRectMake(30, 0, 50, 20);
        self.laughLabel.text = [NSString stringWithFormat:@"%@",laughNumber];
        self.cryLable.frame = CGRectMake(100, 0, 50, 20);
        self.cryLable.text = [NSString stringWithFormat:@"%@",cryNumber];
        self.share.frame = CGRectMake(self.frame.size.width - 60, self.frame.size.height, 40, 20);
        self.share.imageView.image = [UIImage imageNamed:@"share.png"];
        [self addSubview:self.laugh];
        [self addSubview:self.laughLabel];
        [self addSubview:self.cry];
        [self addSubview:self.cryLable];
        [self addSubview:self.share];
        [_laugh addTarget:self.laugh action:@selector(buttonActionLaugh:) forControlEvents:UIControlEventTouchUpOutside];
        [_cry addTarget:self.cry action:@selector(buttonActionCry:) forControlEvents:UIControlEventTouchUpOutside];
        [_share addTarget:self.share action:@selector(buttonActionShare:) forControlEvents:UIControlEventTouchUpOutside];
//    }
    
    return self;
}

- (void)buttonActionLaugh:(UIButton *)button
{
    // 点击笑脸后
}

- (void)buttonActionCry:(UIButton *)button
{
    // 点击哭脸后
}

- (void)buttonActionShare:(UIButton *)button
{
    // 点击分享按钮
}



- (void)dealloc
{
    [_laugh release];
    [_cry release];
    [_share release];
    [_laughLabel release];
    [_cryLable release];
    [super dealloc];
}

@end
